package com.module.launcher.view.fragment

import android.content.Intent
import androidx.fragment.app.Fragment
import com.module.app.base.BaseFragment
import com.module.app.base.BaseViewModel
import com.module.base.utils.LogUtils
import com.module.launcher.R
import com.module.launcher.databinding.LauncherFragMyBinding


class HomeMyFragment : BaseFragment<BaseViewModel, LauncherFragMyBinding>() {
    private val mIMyService: com.module.app.arouter.service.IMyService by lazy {
        com.module.app.arouter.ArouterUtils.getMyService()
    }
    var fragment: Fragment? = null


    override fun bingViewModel() {
        LogUtils.e("")
    }

    override fun onLazyLoad() {
    }

    override fun initView() {
        super.initView()
        val beginTransaction = childFragmentManager.beginTransaction()
        if (beginTransaction == null || mIMyService == null) {
            return
        }
        fragment = mIMyService?.myFragment
        fragment?.let {
            beginTransaction.replace(R.id.fragment, fragment!!)
            beginTransaction.commit()
        }
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)
        fragment?.onActivityResult(requestCode, resultCode, data)
    }
}